<script lang="ts" setup>
const props = defineProps<{
    modelValue: number
}>()

const emits = defineEmits<{
    'update:modelValue': [val: number]
}>()

const onInput = (event: Event) => {
    emits('update:modelValue', Number((event.target as HTMLInputElement).value))
}
</script>

<template>
    <button @click="emits('update:modelValue', props.modelValue - 1)">-</button>
    <input type="text" :value="modelValue" @input="onInput" />
    <button @click="emits('update:modelValue', props.modelValue + 1)">+</button>
</template>